#include "spy_str.hpp"
#include <stdlib.h>
#include <string.h>

namespace smallpy {
  namespace datastructures {
    template <typename T>
    DynamicList<T>::DynamicList() : DynamicList(NULL, 10) {}

    template <typename T>
    DynamicList<T>::DynamicList(T *buf, int len) {
      this->buf = (T *) malloc(len * sizeof(T));
      if (buf) memcpy(this->buf, buf, sizeof(T) * len);
      this->len = len;
      this->capacity = len * 3 / 2;
      if (!buf) this->len = 0;
    }

    template <typename T>
    DynamicList<T>::DynamicList(const DynamicList<T> &other) {
      len = other.len;
      capacity = other.capacity;
      free(buf);
      buf = (T *) malloc(sizeof(T) * len);
      memcpy(buf, other.buf, len * sizeof(T));
    }

    template <typename T>
    DynamicList<T>::~DynamicList() {
      free(buf);
    }

    template <typename T>
    DynamicList<T> &DynamicList<T>::operator=(const DynamicList<T> &other) {
        if (this == other) return *this;
    }
  }
}

using namespace smallpy::datastructures;
int main() {
    String str;
    String str2(str);
}